﻿using System.Windows;
using System.Windows.Media;

using Microsoft.Phone.Controls;

namespace SignalsAccuracySample
{
    using System.Collections.Generic;

    using devMobile.Controls.Status;

    public partial class MainPage : PhoneApplicationPage
    {
        /// <summary>
        /// </summary>

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += this.MainPage_Loaded;
            this.statusRound.MaxValue = 50;
            this.status.MaxValue = 50;
            this.status.RangeBehaviourCollection =
                devMobile.Controls.Status.BuiltInRangeBehaviours.StateValueRangeBehaviour.CreateThreeStates();
            this.statusRound.RangeBehaviourCollection = devMobile.Controls.Status.BuiltInRangeBehaviours.StateValueRangeBehaviour.CreateFourStates();
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            status.SignalColor = new SolidColorBrush(Colors.Blue);
            statusRound.SignalColor = new SolidColorBrush(Colors.Red);
            status.Orientation = devMobile.Controls.Status.Orientation.Horizontal;
        }

        private void newValue(object sender, System.Windows.RoutedPropertyChangedEventArgs<double> e)
        {
            status.Value = (int)e.NewValue;
            statusRound.Value = (int)e.NewValue;
            this.textBlock1.Text = e.NewValue.ToString();
        }
    }
}